package com.song.shop.rabbitmq;

import java.util.Date;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class FanoutSend {
	
	@Autowired
	private AmqpTemplate amqpTemplate ;
	
	public void send() {
		String msg = "Fanoutmessage"+ new Date().getTime() ; 
//		amqpTemplate.convertAndSend("fanoutExchange", "", msg);
		amqpTemplate.send(new Message(msg.getBytes(),new MessageProperties()));
	}
}
